import { Body, Controller, Post } from '@nestjs/common';
import { BannerService } from './banner.service';
import { ApiBearerAuth, ApiBody, ApiConsumes, ApiOperation, ApiTags } from '@nestjs/swagger';
import { CreateBannerDto } from './banner.dto';

@ApiTags('Banner - 轮播图')
@ApiBearerAuth()
@Controller('cms/banner')
export class BannerController {
  constructor(private readonly bannerService: BannerService) {}

	@Post()
	@ApiOperation({ summary: '创建banner' })
	@ApiBody({type: CreateBannerDto})
	async createBanner(@Body() dto: CreateBannerDto) {
		return await this.bannerService.create(dto);
	}
}
